import Vue from 'vue'
import VueRouter from 'vue-router'
import CreateArticle from './../views/CreateArticle'
import ListArticle from './../views/ListArticle'
import EditArticle from './../views/EditArticle'

Vue.use(VueRouter)

const routes = [
  { path: '/', name: 'home', redirect: '/articles/index' },
  { path: '/articles/index', name: 'ListArticle', component: ListArticle },
  { path: '/articles/create', name: 'CreateArticle', component: CreateArticle },
  { path: '/articles/:id/edit', name: 'EditArticle', component: EditArticle }
]

const router = new VueRouter({
  routes
})

export default router
